﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Configuration;
using Citi.Helpers;
using System.Timers;
using System.Threading;
using System.Net;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Citi.Inquiry.Extractor.Util;

namespace Citi.Inquiry.Extractor.WindowsUI
{
    public partial class frmExtractor : Form
    {
        string templateReportName;
        string singleSignOnUrl;
        string userLogin;
        string pathToSave;
        string parameters;

        public frmExtractor(string templateReportName, string singleSignOnUrl, string userLogin, string pathToSave, string parameters)
        {
            InitializeComponent();

            webControl.Height = Height;
            webControl.Width = Width;
            //MinimumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);

            this.templateReportName = templateReportName;
            this.singleSignOnUrl = singleSignOnUrl;
            this.pathToSave = pathToSave;
            this.userLogin = userLogin;
            this.parameters = parameters;

            webControl.WebView = new EO.WebBrowser.WebView();
        }

        void frmExtractor_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(Environment.ExitCode);
        }

        private void frmExtractor_Load(object sender, EventArgs e)
        {
            new InquiryExtract().StartExtraction(webControl, templateReportName, singleSignOnUrl, userLogin, pathToSave, parameters, this);
        }

        private void frmExtractor_Resize(object sender, EventArgs e)
        {
            webControl.Height = Height;
            webControl.Width = Width;
        }
    }
}
